<?php
include(dirname(__FILE__) . '/../../../bootstrap/unit.php');
require_once sfConfig::get('sf_symfony_lib_dir') . '/util/sfToolkit.class.php';
require_once sfConfig::get('sf_symfony_lib_dir') . '/yaml/sfYaml.php';

Logger::configure(dirname(__FILE__) . '/../../log4phpconfig.properties');

$configuration = ProjectConfiguration::getApplicationConfiguration( 'backend', 'test', true);
new sfDatabaseManager($configuration);
//echo sfConfig::get('sf_data_dir').'/fixtures';
//
//Doctrine_Core::generateModelsFromYaml('schema.yml', 'models');
//
//$manager = Doctrine_Manager::getInstance();
//$conn = $manager->getCurrentConnection();
//
//echo "\nDriver name. " . $conn->getName() . "\n";

//Doctrine_Core::createTablesFromModels(sfConfig::get('sf_app_lib_dir') . '/model/doctrine/base', Doctrine_Core::MODEL_LOADING_CONSERVATIVE);
//Doctrine_Core::loadData(sfConfig::get('sf_data_dir').'/fixtures');
//$task = new sfDoctrineBuildTask();
//$task->execute(array(), array('--all','--no-confirmation','--and-load'));
$methodName="createTimeCards";
$tcount = count(1);

$t = new lime_test($tcount);
$pos = Doctrine::getTable('Position')->positionForDate(1, new DateTime('2010-1-1'));
 echo "Position:  ". $pos->getName() . "\n";

$pos = Doctrine::getTable('Position')->positionForDate(1, new DateTime('2009-5-1'));
echo "Position:  ". $pos->getName() . "\n";

$pos = Doctrine::getTable('Position')->positionForDate(1, new DateTime('2009-7-15'));
echo "Position:  ". $pos->getName() . "\n";

$pos = Doctrine::getTable('Position')->positionForDate(1, new DateTime('2008-7-15'));
echo "Position:  ". $pos->getName() . "\n";
if($pos->getName() == null){
    echo "\tIs null " . ($pos->getName() == null). "\n";
}

echo "\tIs empty " . (empty($pos)). "\n";
$pos = Doctrine::getTable('Position')->positionForDate(1, new DateTime('2010-10-7'));
 echo "Position:  ". $pos->getName() . "\n";
?>
